import java.math.BigInteger;
import java.util.*;

public class Chapter1 {
    static char[] a;
    BigInteger two= BigInteger.valueOf(2);
    BigInteger f= BigInteger.valueOf(3);


    public static void main(String[] args) {
        int count=0;
        for(int i=1;i<=1000;i++){
            for(int j=1;j<=1000;j++){
                if(i*i+j*j<=1000*1000){
                    count++;
                }

            }
        }
        System.out.println("count = " + count*4);
        List<Integer> ins = new ArrayList<Integer>();
        ins.add(1);
        ins.add(2);
        ins.add(15);
        ins.add(-1);
        System.out.println(ins.contains(1));//判断某个是否存在
        Collections.sort(ins);
        System.out.println("ins = " + ins);
        /**
         * 字符串版本
         */
        List<String> ins2 = new ArrayList<String>();
       StringBuffer sb = new StringBuffer();
        ins2.add("1");
        ins2.add("2");
        ins2.add("5");
        ins2.add("-1");
        ListIterator<String> li= ins2.listIterator();


        for (String s : ins2) {
            System.out.println(" = " + s);
        }
        while (li.hasNext()) {//使用IIterator迭代器，实现List集合输出
            System.out.println(" = " + li.next());
        }
        for (int i = 0; i < ins.size(); i++) {//利用String提供的toCharArray方法完成String到Char[]的转换
            a=new char[ins.size()];
            a = ins2.get(i).toCharArray();

        }
        System.out.println("a[] = " + a[0]);
//        System.out.println(ins.contains(1));//判断某个是否存在
//        Collections.sort(ins);
//        System.out.println("ins = " + ins);

    }
}


